package com.quanxiaoha.xiaohashu.user.api;


import com.quanxiaoha.framework.common.response.Response;
import com.quanxiaoha.xiaohashu.user.constant.ApiConstants;
import com.quanxiaoha.xiaohashu.user.dto.req.FindUserByIdReqDTO;
import com.quanxiaoha.xiaohashu.user.dto.req.FindUserByPhoneReqDTO;
import com.quanxiaoha.xiaohashu.user.dto.req.RegisterUserReqDTO;
import com.quanxiaoha.xiaohashu.user.dto.req.UpdateUserPasswordReqDTO;
import com.quanxiaoha.xiaohashu.user.dto.resp.FindUserByIdRspDTO;
import com.quanxiaoha.xiaohashu.user.dto.resp.FindUserByPhoneRspDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author: jingyan_liu
 * @CreateTime: 2025-07-22
 * @Description:
 * @Version: 1.0
 */


@FeignClient(name = ApiConstants.SERVICE_NAME)
public interface UserFeignApi {
	
	String PREFIX = "/user";
	
	@PostMapping(value = PREFIX + "/register")
	Response<Long> registerUser(@RequestBody RegisterUserReqDTO registerUserReqDTO);
	
	@PostMapping(PREFIX + "/findByPhone")
	Response<FindUserByPhoneRspDTO> findByPhone(@Validated @RequestBody FindUserByPhoneReqDTO findUserByPhoneReqDTO);
	
	@PostMapping(PREFIX + "/password/update")
	Response<?> updatePassword(@Validated @RequestBody UpdateUserPasswordReqDTO updateUserPasswordReqDTO);
	
	@PostMapping(PREFIX + "/findById")
	Response<FindUserByIdRspDTO> findById(@Validated @RequestBody FindUserByIdReqDTO findUserByIdReqDTO);
}